/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "far_ingreso_medicamento_detalle")
@NamedQueries({
    @NamedQuery(name = "FarIngresoMedicamentoDetalle.findAll", query = "SELECT f FROM FarIngresoMedicamentoDetalle f")})
public class FarIngresoMedicamentoDetalle implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "fid_id")
    private Integer fidId;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @Column(name = "fid_cantidad")
    private BigDecimal fidCantidad;
    @Basic(optional = false)
    @Column(name = "fid_subtotal")
    private BigDecimal fidSubtotal;
    @Column(name = "fid_descuento")
    private BigDecimal fidDescuento;
    @Basic(optional = false)
    @Column(name = "fid_total")
    private BigDecimal fidTotal;
    @Basic(optional = false)
    @Column(name = "fid_registro_sanitario")
    private String fidRegistroSanitario;
    @Column(name = "fid_codigo_barra")
    private String fidCodigoBarra;
    @Basic(optional = false)
    @Column(name = "fid_valor_unitario")
    private BigDecimal fidValorUnitario;
    @Basic(optional = false)
    @Column(name = "fid_fecha_caducidad")
    @Temporal(TemporalType.DATE)
    private Date fidFechaCaducidad;
    @Basic(optional = false)
    @Column(name = "fid_lote")
    private String fidLote;
    @JoinColumn(name = "fme_id", referencedColumnName = "fme_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private FarIngresoMedicamento farIngresoMedicamento;
    @JoinColumn(name = "ffa_id", referencedColumnName = "ffa_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private FarFormaFarmaceutica farFormaFarmaceutica;
    @OneToMany(mappedBy = "farIngresoMedicamentoDetalle", fetch = FetchType.LAZY)
    private List<FarStock> farStockList;

    public FarIngresoMedicamentoDetalle() {
    }

    public FarIngresoMedicamentoDetalle(Integer fidId) {
        this.fidId = fidId;
    }

    public FarIngresoMedicamentoDetalle(Integer fidId, BigDecimal fidCantidad, BigDecimal fidSubtotal, BigDecimal fidTotal, String fidRegistroSanitario, BigDecimal fidValorUnitario, Date fidFechaCaducidad, String fidLote) {
        this.fidId = fidId;
        this.fidCantidad = fidCantidad;
        this.fidSubtotal = fidSubtotal;
        this.fidTotal = fidTotal;
        this.fidRegistroSanitario = fidRegistroSanitario;
        this.fidValorUnitario = fidValorUnitario;
        this.fidFechaCaducidad = fidFechaCaducidad;
        this.fidLote = fidLote;
    }

    public Integer getFidId() {
        return fidId;
    }

    public void setFidId(Integer fidId) {
        this.fidId = fidId;
    }

    public BigDecimal getFidCantidad() {
        return fidCantidad;
    }

    public void setFidCantidad(BigDecimal fidCantidad) {
        this.fidCantidad = fidCantidad;
    }

    public BigDecimal getFidSubtotal() {
        return fidSubtotal;
    }

    public void setFidSubtotal(BigDecimal fidSubtotal) {
        this.fidSubtotal = fidSubtotal;
    }

    public BigDecimal getFidDescuento() {
        return fidDescuento;
    }

    public void setFidDescuento(BigDecimal fidDescuento) {
        this.fidDescuento = fidDescuento;
    }

    public BigDecimal getFidTotal() {
        return fidTotal;
    }

    public void setFidTotal(BigDecimal fidTotal) {
        this.fidTotal = fidTotal;
    }

    public String getFidRegistroSanitario() {
        return fidRegistroSanitario;
    }

    public void setFidRegistroSanitario(String fidRegistroSanitario) {
        this.fidRegistroSanitario = fidRegistroSanitario;
    }

    public String getFidCodigoBarra() {
        return fidCodigoBarra;
    }

    public void setFidCodigoBarra(String fidCodigoBarra) {
        this.fidCodigoBarra = fidCodigoBarra;
    }

    public BigDecimal getFidValorUnitario() {
        return fidValorUnitario;
    }

    public void setFidValorUnitario(BigDecimal fidValorUnitario) {
        this.fidValorUnitario = fidValorUnitario;
    }

    public Date getFidFechaCaducidad() {
        return fidFechaCaducidad;
    }

    public void setFidFechaCaducidad(Date fidFechaCaducidad) {
        this.fidFechaCaducidad = fidFechaCaducidad;
    }

    public String getFidLote() {
        return fidLote;
    }

    public void setFidLote(String fidLote) {
        this.fidLote = fidLote;
    }

    public FarIngresoMedicamento getFarIngresoMedicamento() {
        return farIngresoMedicamento;
    }

    public void setFarIngresoMedicamento(FarIngresoMedicamento farIngresoMedicamento) {
        this.farIngresoMedicamento = farIngresoMedicamento;
    }

    public FarFormaFarmaceutica getFarFormaFarmaceutica() {
        return farFormaFarmaceutica;
    }

    public void setFarFormaFarmaceutica(FarFormaFarmaceutica farFormaFarmaceutica) {
        this.farFormaFarmaceutica = farFormaFarmaceutica;
    }

    public List<FarStock> getFarStockList() {
        return farStockList;
    }

    public void setFarStockList(List<FarStock> farStockList) {
        this.farStockList = farStockList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (fidId != null ? fidId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FarIngresoMedicamentoDetalle)) {
            return false;
        }
        FarIngresoMedicamentoDetalle other = (FarIngresoMedicamentoDetalle) object;
        if ((this.fidId == null && other.fidId != null) || (this.fidId != null && !this.fidId.equals(other.fidId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "newpackage.FarIngresoMedicamentoDetalle[ fidId=" + fidId + " ]";
    }
    
}
